#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
    
    pid_t id = fork();
    if (id < 0)
    {
        perror("fork file");
        exit(-1);
    }

    if (id == 0)
    {
        //while (1)
        //{
            printf("I am child , child pid = %d\n", getpid());
            sleep(5);
            exit(1);
        //}
    }
    else 
    {
        while (1)
        {
            printf("I am father , father pid = %d\n", getpid());
            sleep(1);
        }
        //exit(1);
    }

    return 0;
}

